//
//  MMGAppConfig.h
//  MyApp
//
//  Created by Don on 2017/8/24.
//  Copyright © 2017年 com.memego. All rights reserved.
//

#ifndef MMGAppConfig_h
#define MMGAppConfig_h

#ifdef DEBUG
#define DLog(s, ...) NSLog(@"%s(%d): %@", __FUNCTION__, __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__])
#else
//TODO:- 未知原因 正式环境不做打印 会造成CPU上升，且视频无法播放
#define DLog(...) NSLog(@"")
#endif

#define MMGWeakSelf(weakSelf) __weak __typeof(&*self)weakSelf = self
/**
 *  判断字符串是否为空
 *
 *  @param string 要判断的字串
 *
 *  @return BOOL string is null or empty
 */
/********** 方法简写 ************/
// 判断NSString是否为空
#define NSStringIsNullOrEmpty(string) (([string isKindOfClass:[NSString class]] && [(NSString *)string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]].length > 0) ? NO : YES)

/*! 域名配置*/
#define kDOMAIN_DEVELOP_VIDEO @"live.win-100.top"//@"139.199.191.99"
#define kDOMAIN_RELEASE_VIDEO @"live.win-100.top"//@"203.135.156.6"
#define kDOMAIN_DEVELOP @"control.win-100.top"//@"123.207.62.233"
#define kDOMAIN_RELEASE @"control.win-100.top"//@"139.199.191.99"

#define kPRIZE_CLAW_MACHINE_ID @"1c73f77e5e5649beacc4f7118cd0a9f7"//测试用
//#define kDEVICE_USER_AUTHO_CODE @"0e0e6eb2dea34953846af106a0d46bb5"//测试用


/**
 * APP版本号
 */
#define kMMG_SYS_APP_VERSION [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"]
#define kMMG_SYS_APP_BUILD_VERSION [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]

/**
 *  当前设备是否为iPad
 */
#define MMG_DEVICE_IS_IPAD ([[UIDevice currentDevice].model hasPrefix:@"iPad"])
/**
 *  设备判断相关
 */
#define kDeviceIsiPhone4Screen ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)
#define kDeviceIsiPhone5Screen  ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#define kDeviceIsiPhone6Screen  ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO)
#define kDeviceIsiPhone6PlusScreen  ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO)
#define kDeviceIsiPhoneXScreen  ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
#define kDeviceIsIPadScreen ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1536, 2048), [[UIScreen mainScreen] currentMode].size) : NO)
#define kDeviceIsSmallScreen (kDeviceIsiPadScreen || kDeviceIsiPhone4Screen || kDeviceIsiPhone5Screen)


#ifdef DEBUG
/**
 *  视频直播测试场
 *
 *  @return 测试场路径
 */
#define kVIDEO_SERVICE_HOST [NSString stringWithFormat:@"%@",kDOMAIN_DEVELOP_VIDEO]
#define kIAP_PRODUCTION_ENVIROMENT 0
#else

/**
 *  视频直播正式场
 *
 *  @return 正式场路径
 */
#define kVIDEO_SERVICE_HOST [NSString stringWithFormat:@"%@",kDOMAIN_RELEASE_VIDEO]
#define kIAP_PRODUCTION_ENVIROMENT 1
#endif

#ifdef DEBUG
/**
 *  测试场
 *
 *  @return 测试场路径
 */
#define kSERVICE_HOST [NSString stringWithFormat:@"%@",kDOMAIN_DEVELOP]

#else

/**
 *  正式场
 *
 *  @return 正式场路径
 */
#define kSERVICE_HOST [NSString stringWithFormat:@"%@",kDOMAIN_RELEASE]

#endif

#endif /* MMGAppConfig_h */
